<template>
  <div class="box1">
    <h1>这是header基础写法取值{{this.$store.state.count}}</h1>

    <h1>这是header的mapState方法取值{{count1}}</h1>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
    name:"Header",
    computed:{
        // mapState方法取值的对象写法
        ...mapState({count1:'count'})
    }

}
</script>

<style>
.box1{
    width: 100%;
    height: 150px;
    background-color: aquamarine;
    text-align: center;
}
</style>